<?php
global $_W, $_GPC;

$input = $_GPC['__input'];
$id = $_GPC['id'];

$item = pdo_get('iwe7_builder_forms', array('id' => $id));
$params = unserialize($item['paramas']);
$fields = unserialize($item['fields']);

$table = $item['table'];
$data = array();
$search = array();
foreach ($params as $pa) {
    $search[$pa['table']] = $_GPC[$pa['name']];
}

foreach ($fields as $fi) {
    $data[$fi['name']] = $input[$fi['name']];
}

pdo_insert($table, $data);
$data['id'] = pdo_insertid();

die(json_encode($data));
